package com.wlz.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author wlz
 * @date 2022-06-29  11:07 下午
 */
@Slf4j
@Component
public class RabbitmqListener {

    /**
     *  定义方法进行监听
     * @param message
     */
    @RabbitListener(queues = "wlz_boot_queue")
    public void listenerQueue(Message message) {

        log.info("队列 wlz_boot_queue， message: {}", new String(message.getBody()));
    }
}
